package fr.cie.blog.domainservice;

import java.util.List;

import fr.cie.blog.beans.Article;
import fr.cie.blog.beans.Comment;
import fr.cie.blog.modeldao.hib.ArticleDaoImplHib;

/**
 * @author Jee3
 * 
 */
public class ServiceArticleDao implements IServiceArticle {

	/**
	 * serviceArticleImpl.
	 */
	private final IServiceArticle servArticleImpl = new ArticleDaoImplHib();

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.cie.blog.domainservice.IServiceGeneric#create(java.lang.Objecarticle)
	 */
	@Override
	public final int save(final Article article) {
		return servArticleImpl.save(article);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.cie.blog.domainservice.IServiceGeneric#delete(java.lang.Objecarticle)
	 */
	@Override
	public final int delete(final Article article) {
		return servArticleImpl.delete(article);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see fr.cie.blog.domainservice.IServiceGeneric#findAll()
	 */
	@Override
	public final List<Article> findAll() {
		return servArticleImpl.findAll();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.cie.blog.domainservice.IServiceArticle#findByCategory(fr.cie.blog.
	 * beans.Category)
	 */
	@Override
	public final List<Article> findByCategory(final long categoryId) {
		return servArticleImpl.findByCategory(categoryId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.cie.blog.domainservice.IServiceArticle#findByComment(fr.cie.blog.beans
	 * .Comment)
	 */
	@Override
	public final Article findByComment(final Comment pComment) {
		return servArticleImpl.findByComment(pComment);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see fr.cie.blog.domainservice.IServiceGeneric#findById(int)
	 */
	@Override
	public final Article findById(final long pIdentifier) {
		return servArticleImpl.findById(pIdentifier);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see fr.cie.blog.domainservice.IServiceArticle#get5lastArticles()
	 */
	@Override
	public final List<Article> findFiveLastArticles() {
		return servArticleImpl.findFiveLastArticles();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * fr.cie.blog.domainservice.IServiceGeneric#save(java.lang.Objecarticle)
	 */
	@Override
	public final int update(final Article article) {
		return servArticleImpl.update(article);
	}

}